<template>
  <section class="main">
    <div class="frame-header">
      <div class="logo ml-20">
        <img :src="headerLogo" />
        <span class="title">{{ headerTitle }}</span>
      </div>
      <div class="user">
        <!--全屏 -->
        <fullscreen></fullscreen>
        <span class="mr-5"></span>
        <!--头像组件 -->
        <avatar-icon></avatar-icon>
      </div>
    </div>
    <!--组件 -->
    <div class="frame-main">
      <navWrapper :menus="menus" :defaultPath="defaultPath"></navWrapper>
    </div>
  </section>
</template>
<script lang="ts">
import { Component, Vue, Prop } from "vue-property-decorator";
import { State, Mutation } from "vuex-class";
import { Tools } from "@/model/tools.ts";
import AvatarIcon from "@components/iv-avatar/AvatarIcon.vue";
import navWrapper from "@components/layout/navWrapper.vue";
import { MenuList } from "@/store/interface";
@Component({
  components: { AvatarIcon, navWrapper }
})
export default class Home extends Tools {
  @State private defaultPath!: String;
  @State private menus!: MenuList;
  private get headerTitle() {
    return "喵喵系统";
  }
  @State private logoUrl!: string;

  private get headerLogo() {
    return this.logoUrl ? this.logoUrl : require("../assets/img/home-logo.png");
  }
}
</script>
<style lang="stylus" scoped>
.main {
  min-height: 100vh
  background-color: #fff
  .frame-main {
    background-color: #f2f5fa
    padding-top: 64px
    min-height: calc(100vh - 64px)
  }
  .frame-header {
    position: fixed
    width: 100%
    z-index: 10
    background: #fff
    display: flex
    justify-content: space-between
    box-shadow: 0 2px 4px 2px rgba(0, 0, 0, 0.1)
    height: 64px
    border-bottom: 1px solid #dcdee2
    .logo {
      align-items: center
      img {
        vertical-align: middle
      }
    }
    .title {
      margin-left: 10px
      font-size: 20px
      height: 64px
      line-height: 64px
      font-weight: 900
      color: #657180
      vertical-align: middle
    }
    .user {
      display: flex
      justify-content: center
      align-items: center
    }
  }
}
</style>
